Current Location: Home> Function Categories> cos

cos

Cosine
Name:cos
Category:math
Programming Language:php
One-line Description:Cosine.

Definition and usage

cos() function returns the cosine of a number.

Example

In this case, we will calculate the cosines of different values:

 <?php
echo ( cos ( 3 ) ) ;
echo ( cos ( - 3 ) ) ;
echo ( cos ( 0 ) ) ;
echo ( cos ( M_PI ) ) ;
echo ( cos ( 2 * M_PI ) ) ;
?>

Try it yourself

grammar

 cos ( x )
parameter describe
x Required. A number.

illustrate

cos() returns the cosine value of the parameter x . The unit of parameter x is radians.

Similar Functions
  • Find the minimum value min

    min

    Findtheminimumvalue
  • Convert decimal to hexadecimal dechex

    dechex

    Convertdecimaltohexa
  • Returns log(1 + number), and can calculate the exact result even when the value of number is close to zero. log1p

    log1p

    Returnslog(1+number)
  • Perform floating point division under IEEE 754 semantics fdiv

    fdiv

    Performfloatingpoint
  • Sine sin

    sin

    Sine
  • Round the division result intdiv

    intdiv

    Roundthedivisionresu
  • Generate a random integer rand

    rand

    Generatearandominteg
  • Determine whether it is infinite is_infinite

    is_infinite

    Determinewhetheritis
Popular Articles